import { User, UserQuery } from './../types/user';
import request from '../utils/request'
import { ApiRel } from '@/types/data'

export const login = (data: { adminname: string, password: string }) => {
    return request<ApiRel<User>>({
        url: 'admin/login',
        method: 'POST',
        data
    })
}
//获取用户信息
export const getUserInfo = () => {
    return request<ApiRel<User>>({
        url: 'admin/detail'
    })

}
//分页获取用户列表
export const getUserList = (params: UserQuery) => {
    return request<ApiRel<{ total: number, items: User[] }>>({
        url: 'admin/list',
        params
    })
}